@extends('admin.layouts.base')

@section('css')
    <style>
        .form-group{margin-bottom: 0;}.m-b{margin-bottom: 0;}.radio-inline{margin-right: 20px} .radio-inline label{margin-top: 1px;}
    </style>
@stop
@section('content')
    @include('admin.site._top')
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{trans('site.system_parameter')}}</h5>
                    </div>
                    @include('admin.partials.success')
                    @include('admin.partials.errors')
                    <div class="ibox-content">
                        <form method="POST" action="{{url('admin/site/index')}}" class="form-horizontal">
                            {{ csrf_field() }}
                            <input type="hidden" name="group_id" value="2">
                            <input type="hidden" name="jumpUrl" value="admin/site/sys_param">
                            @foreach($data['parameter_config'] as $row)
                                @if($row->var_key == 'sys_skin')
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">系统主题：</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b">
                                                <div class="radio radio-info radio-inline" data-value="skin-0">
                                                    <input type="radio" id="inlineRadio1" value="skin-0" @if($row->var_value=='skin-0')  checked="checked" @endif name="sys_skin">
                                                    <label for="inlineRadio1">DEFAULT</label>
                                                </div>
                                                <div class="radio radio-inline radio-success" data-value="skin-1">
                                                    <input type="radio" id="inlineRadio2" value="skin-1" @if($row->var_value=='skin-1')  checked="checked" @endif name="sys_skin">
                                                    <label for="inlineRadio2">BLUE</label>
                                                </div>
                                                <div class="radio radio-inline" data-value="skin-2">
                                                    <input type="radio" id="inlineRadio3" value="skin-2" @if($row->var_value=='skin-2')  checked="checked" @endif name="sys_skin">
                                                    <label for="inlineRadio3">ULTRA</label>
                                                </div>
                                                <div class="radio radio-inline" data-value="skin-3">
                                                    <input type="radio" id="inlineRadio4" value="skin-3" @if($row->var_value=='skin-3')  checked="checked" @endif name="sys_skin">
                                                    <label for="inlineRadio4">YELLOW</label>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                @elseif($row->var_key == 'debug')
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Debug调试模式：</label>
                                        <div class="col-sm-5" style="margin-top: 7px;">
                                            <div class="input-group m-b">
                                                <div class="switch">
                                                    <div class="onoffswitch">
                                                        <input type="checkbox" name="debug" value="true" @if($row->var_value=='true') checked=""@endif class="onoffswitch-checkbox" id="example1">
                                                        <label class="onoffswitch-label" for="example1">
                                                            <span class="onoffswitch-inner"></span>
                                                            <span class="onoffswitch-switch"></span>
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                @elseif($row->var_key == 'timezone')
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">时区：</label>
                                        <div class="col-sm-5">
                                            <div class="input-group m-b">
                                                <select class="form-control m-b" name="timezone">
                                                    <option value="zh-CN" @if($row->var_value=='Asia/Shanghai') selected @endif>中国上海 Asia/Shanghai</option>
                                                    <option value="UTC" @if($row->var_value=='UTC') selected @endif>世界时间 UTC</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                @elseif($row->var_key == 'locale')
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">语言：</label>
                                        <div class="col-sm-5">
                                            <div class="input-group m-b">
                                                <select class="form-control m-b" name="locale">
                                                    <option value="zh-CN" @if($row->var_value=='zh-CN') selected @endif>中文 zh-CN</option>
                                                    <option value="en" @if($row->var_value=='en') selected @endif>英文 English</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                @endif
                            @endforeach
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-white" type="reset">Cancel</button>
                                    <button class="btn btn-primary" type="submit">Submit</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop
@section('js')
    <script type="text/javascript">
        $('.radio').bind('click',function () {
            var skin = $(this).attr('data-value');
            $('body').removeClass();
            $('body').addClass('pace-done '+skin);
        })
    </script>
@endsection